<extend name="Public/base"/>

<block name="body">
    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <div class="main-title">
        <h2>
            <if condition="ACTION_NAME eq 'add'">
                新增赛事
            <else/>
                编辑赛事
            </if>
            <button class="btn btn-default btn-return" onclick="javascript:history.back(-1);return false;"><i class="glyphicon glyphicon-share-alt"></i> 返 回</button>
        </h2>
    </div>
    <div class="tab-wrap">
        <ul class="tab-nav nav nav-tabs">
            <li data-tab="tab1" class="current"><a href="javascript:void(0);">基本</a></li>
            <li data-tab="tab2"><a href="javascript:void(0);">LOGO</a></li>
            <li data-tab="tab3"><a href="javascript:void(0);">赛程</a></li>
        </ul>
    </div>
    <div class="tab-content">
        <form action="" method="post" class="form">
            <div id="tab1" class="tab-pane in tab1">
                <div class="form-item form-group">
                    <label class="item-label">游戏<span class="check-tips"></span></label>
                    <div class="controls">
                        <select name="game_id">
                            <option value="">--请选择--</option>
                            <volist name="games" id="game">
                                <option value="{$game.id}" <eq name="game['id']" value="$game_id"> selected</eq>>
                                    {$game.name}
                                </option>
                            </volist>
                        </select>
                    </div>
                </div>

                <div class="form-item form-group">
                    <label class="item-label">赛程安排状态<span class="check-tips"></span></label>
                    <div class="controls">
                         <label class="radio-inline"><input type="radio" name="match_state" value="2">直播中</label>
                         <label class="radio-inline"><input type="radio" name="match_state" value="1">预告</label>
                         <label class="radio-inline"><input type="radio" name="match_state" value="0">普通</label>
                    </div>
                </div>


                <div class="form-item form-group">
                    <label class="item-label">标题<span class="check-tips"></span></label>
                    <div class="controls">
                        <input type="text" class="text input-small form-control" name="title" value="{$title|htmlspecialchars_decode}">
                    </div>
                </div>

                <div class="form-item form-group">
                    <label class="item-label">副标题<span class="check-tips"> （短标题，用于APP显示）</span></label>
                    <div class="controls">
                        <input type="text" class="text input-small form-control" name="subtitle" value="{$subtitle|htmlspecialchars_decode}">
                    </div>
                </div>

                <div class="form-item form-group">
                    <label class="item-label">赛事日期<span class="check-tips"></span></label>
                    <div class="controls">
                        <input type="text" class="text input-mini form-control time" name="match_time" value="{$match_time|date="Y-m-d",###}"
                        placeholder="赛事时间">
                    </div>
                </div>

                <div class="form-item form-group">
                    <label class="item-label">描述<span class="check-tips"></span></label>
                    <div class="controls">
                        <label class="input-large">
                            <textarea class="form-control" rows="4" name="detail">{$detail|htmlspecialchars_decode}</textarea>
                        </label>
                    </div>
                </div>
                <div class="form-item form-group">
                    <label class="item-label">排序<span class="check-tips">升序排 数字</span></label>
                    <div class="controls">
                        <input type="number" class="text input-mini" name="sort" value="{$sort}">
                    </div>
                </div>
                <div class="form-item form-group">
                    <label class="item-label">状态<span class="check-tips"></span></label>
                    <input type="radio" name="status" <if condition="$status eq 1 or $status eq ''">checked</if> value="1"  /> 开启
                    <input type="radio" name="status" <eq name="status" value="0">checked</eq> value="0"  />关闭
                </div>
            </div>
            <div id="tab2" class="tab-pane tab2">
                <div class="form-item form-group cf">
                    <label class="item-label">APP封面<span class="check-tips">(400*400px png)</span></label>
                    <div class="controls">
                        <div class="controls">
                            <input type="file" id="upload_picture_logo">
                            <input type="hidden" name="logo" id="cover_id_logo" value="{$logo}" />
                            <div class="upload-img-box">
                            <notempty name="logo">
                                <div class="upload-pre-item"><img src="{:url_format($logo)}"/></div>
                            </notempty>
                            </div>
                        </div>
                        {:hook('adminPicUpload', array('id'=>"upload_picture_logo",'return'=>"cover_id_logo", 'type' => 'path'))}                                                              
                    </div>
                </div>

                <div class="form-item form-group cf">
                    <label class="item-label">APP背景<span class="check-tips">(600*338px png/jpg)</span></label>
                    <div class="controls">
                        <div class="controls">
                            <input type="file" id="upload_picture_cover">
                            <input type="hidden" name="cover" id="cover_id_cover" value="{$cover}" />
                            <div class="upload-img-box">
                                <notempty name="cover">
                                <div class="upload-pre-item"><img src="{:url_format($cover)}"/></div>
                                </notempty>
                            </div>
                        </div>
                        {:hook('adminPicUpload', array('id'=>"upload_picture_cover",'return'=>"cover_id_cover", 'type' => 'path'))}                                                              
                    </div>
                </div>

                <div class="form-item form-group cf">
                    <label class="item-label">网站封面<span class="check-tips">(274*138px png/jpg)</span></label>
                    <div class="controls">
                        <div class="controls">
                            <input type="file" id="upload_picture_pc_cover">
                            <input type="hidden" name="pc_cover" id="cover_id_pc_cover" value="{$pc_cover}" />
                            <div class="upload-img-box">
                                <notempty name="pc_cover">
                                <div class="upload-pre-item"><img src="{:url_format($pc_cover)}"/></div>
                                </notempty>
                            </div>
                        </div>
                        {:hook('adminPicUpload', array('id'=>"upload_picture_pc_cover",'return'=>"cover_id_pc_cover", 'type' => 'path'))}
                    </div>
                </div>

                <div class="form-item form-group cf">
                    <label class="item-label">网站播放页背景<span class="check-tips">(1920*740px png/jpg)</span></label>
                    <div class="controls">
                        <div class="controls">
                            <input type="file" id="upload_picture_pc_bg_player">
                            <input type="hidden" name="pc_bg_player" id="cover_id_pc_bg_player" value="{$pc_bg_player}" />
                            <div class="upload-img-box">
                                <notempty name="pc_bg_player">
                                <div class="upload-pre-item"><img src="{:url_format($pc_bg_player)}"/></div>
                                </notempty>
                            </div>
                        </div>
                        {:hook('adminPicUpload', array('id'=>"upload_picture_pc_bg_player",'return'=>"cover_id_pc_bg_player", 'type' => 'path'))}
                    </div>
                </div>

                <div class="form-item form-group cf">
                    <label class="item-label">网站详情页背景<span class="check-tips">(1920*980px png/jpg)</span></label>
                    <div class="controls">
                        <div class="controls">
                            <input type="file" id="upload_picture_pc_bg_detail">
                            <input type="hidden" name="pc_bg_detail" id="cover_id_pc_bg_detail" value="{$pc_bg_detail}" />
                            <div class="upload-img-box">
                                <notempty name="pc_bg_detail">
                                <div class="upload-pre-item"><img src="{:url_format($pc_bg_detail)}"/></div>
                                </notempty>
                            </div>
                        </div>
                        {:hook('adminPicUpload', array('id'=>"upload_picture_pc_bg_detail",'return'=>"cover_id_pc_bg_detail", 'type' => 'path'))}
                    </div>
                </div>

                <div class="form-item form-group cf">
                    <label class="item-label">战队默认LOGO<span class="check-tips">( 队伍无LOGO默认调用, 使用 120*120, 或者1:1的尺寸,)</span></label>
                    <div class="controls">
                        <div class="controls">
                            <input type="file" id="upload_picture_teamlogo">
                            <input type="hidden" name="teamlogo" id="teamlogo_id_teamlogo" value="{$teamlogo}" />
                            <div class="upload-img-box">
                                <notempty name="teamlogo">
                                <div class="upload-pre-item"><img src="{:url_format($teamlogo)}"/></div>
                                </notempty>
                            </div>
                        </div>
                        {:hook('adminPicUpload', array('id'=>"upload_picture_teamlogo",'return'=>"teamlogo_id_teamlogo", 'type' => 'path'))}                                                              
                    </div>
                </div>
            </div>
            <div id="tab3" class="tab-pane tab3">
                <div class="form-item cf">
                    <label class="item-label">赛程安排<span class="check-tips">内容的图片需要右键在属性=>网络图片的地址处补上域名</span></label>
                    <div class="controls">
                        <label class="textarea">
                                <textarea name="schedule">{$schedule}</textarea>
                               
                        </label>
                    </div>
                </div>

                <div class="form-item form-group cf">
                    <label class="item-label">赛程介绍主图<span class="check-tips"></span></label>
                    <div class="controls">
                        <div class="controls">
                            <input type="file" id="upload_picture_schepic">
                            <input type="hidden" name="schepic" id="schepic_id_schepic" value="{$schepic}" />
                            <div class="upload-img-box" id="schepic-img-box">
                                <notempty name="schepic">
                                <div class="upload-pre-item"><img src="{:url_format($schepic)}"/></div>
                                </notempty>
                            </div>
                            <div><a href="javascript:$('#schepic_id_schepic').val('');$('#schepic-img-box').empty()">X</a></div>
                        </div>
                        {:hook('adminPicUpload', array('id'=>"upload_picture_schepic",'return'=>"schepic_id_schepic", 'type' => 'path'))}   
                    </div>
                </div>


            </div>
            
            <div class="form-item form-group">
                <input type="hidden" name="id" value="{$id}" />
                <button class="btn submit-btn ajax-post btn-success btn-block" id="submit" type="submit" target-form="form">确 定</button>
                <!-- <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button> -->
            </div>
        </form>
    </div>
</block>

<block name="script">
    <link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
    <php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
    <link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>

    <script type="text/javascript">
        //导航高亮
        highlight_subnav('{:U('Match/index')}');
        Think.setValue("match_state", '{$match_state|default=0}');
        showTab();
        $(function(){
            $('.time').datetimepicker({
                format: 'yyyy-mm-dd',
                language:"zh-CN",
                minView:2,
                autoclose:true
            });
        });
       
    </script>
</block>
